<html>
<head>
 
</head>
<body style="text-align=center;font-size:24px">
<div id="problemNum" style='background-color:#999999;width:400;text-align:left;'></div>
<div id="problemContent" style='background-color:#bbbbbb;width:400;text-align:left;'></div>
<div id="result" style='color:#ffff22;font-size:48;background-color:#8855ff;width:400;'></div>
 
<script language="javascript">
    //---------------------------------//
    // Project Euler 
    //
    // Author:thrombin
    //   Date:2015-12-07
    //---------------------------------//  
var N=4;
var problem="A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99.Find the largest palindrome made from the product of two 3-digit numbers.";
//solve the problem
var num,i;
var result=0;
var flag=false;
for(i=999;i>100 && !flag;i--){
    num=(~~(i/100))+(i%10)*100+(~~(i%100/10))*10+1000*i;
    for(var j=999;j>100;j--){
        if(num%j==0 && num/j<1000){result=num;flag=true;break;}
    }
     
}
//update browser
document.getElementById("problemNum").innerHTML="Project Euler-Problem "+N;
document.getElementById("problemContent").innerHTML=problem;
document.getElementById("result").innerHTML="Answer:"+result;
 
</script>
</body>
</html>